Repository navigation
feat(plugin-auth): Add User says when a re-added address was already pending - #35162
Conversation
… pending person The add door now answers pendingAgain: true only when the address was already pending, and sys_user.add_sso_user's result dialog reads it, so the row is drawn exactly on a re-add. A plugin-auth pin checks the import result table's columns against a real row answer. Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…lt row; changeset Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 23 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3064633de8ec4f30a4b8542da063cb3e77cd90aa && git checkout 3064633de8ec4f30a4b8542da063cb3e77cd90aa
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a6cf988eb3afc4cbe23fac4caf71206943806c23 0ad415bbcc4163a7c5d2af4f9061427be9af3e9c && git checkout -B drift-repro a6cf988eb3afc4cbe23fac4caf71206943806c23 && git merge --no-ff 0ad415bbcc4163a7c5d2af4f9061427be9af3e9c
node scripts/docs-audit/affected-docs.mjs --json a6cf988eb3afc4cbe23fac4caf71206943806c23 |
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract review brief handed to the isolated reviewer (TIER_DEFAULT, declaration face), posted beside its record: Contract review brief — PR #35162 @
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract reviewServed-tier: Inputs: brief 6973847132; card #34651 (body and all 4 comments: triage 6938946687, regrade 6969710529, claim 6972612725, os-dev-report 6973807530); parent #33187's dev report 6938771548 (open questions 1, 2 and 4) and ruling A 6915677641; PR #35162 (body and comments); the full diff against merge-base Face: the committed file list touches no ① Derived judgments
② Semver level
Findings:
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Final head for L1 · 2026-11-18T09:23ZHead-sha: |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 review (#34651) · 2026-11-18T09:24ZL1: ACCEPT This is the first L1 on this PR. I read the full diff against the merge base The change.
Card Done-when, each item.
Shape and scope.
Evidence. plugin-auth: 5,997 tests passed. platform-objects: 2,047 passed. Both typechecks exit 0. CI at this head, from check-runs: 37 success, 16 skipped, none failed or in progress. Must-fixNone. Should-fixNone. Notes
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Landing · 2026-11-18T09:25Z
Open findings: record nits N1 (docs page and route-ledger note omit State: ready + auto-merge armed by area o1-B (lease Dev-effort: medium · Rounds: 1 |
Requested by Warren · project thread
Fixes #34651
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
alreadyPending会在每次正常新加时画出一行「false」,裁决 A 不接受。pendingAgain: true,alreadyPending原样保留,现有 API 读者不受影响;回滚即 revert 本 PR。packages/plugins/plugin-auth/src/pending-sso-users.ts(runAddSsoUser新增的一行条件展开)、packages/platform-objects/src/identity/sys-user.object.ts(add_sso_user结果弹窗新增的字段)、packages/plugins/plugin-auth/src/pending-sso-users.test.ts(末尾两个新 describe)。pnpm --filter @objectstack/plugin-auth exec vitest run src/pending-sso-users.test.ts -t 34651,预期 3 个用例全绿。What changes
runAddSsoUser: on a re-add of an address that is still pending, the answer gainspendingAgain: true. The key is absent on a fresh add and is neverfalse.alreadyPendingis unchanged and still on every answer, so this only widens the answer.sys_user.add_sso_user: the result dialog gains one field,{ path: 'pendingAgain', label: 'Already pending', format: 'json' }. The dialog skips a field whose path resolves to nothing, so the row shows only on a re-add. The label is translated in the ten platform-objects bundles, the same way the dialog's other fields are labelled (resultDialog.fields.PATH). The bundles were regenerated withnode scripts/check-i18n-bundles.mjs --write, and the translated values were written by hand. Each translation is the "already pending" half of the locale's existingsummary.alreadyPendingstring..changeset/: patch for@objectstack/plugin-authand@objectstack/platform-objects, with the two declaration lines line-initial.Why
pendingAgain. The card leaves the name to precedent. The precedent is the parent card's dev report (6938771548, open question 1, option B, "for example pendingAgain: true"). The seat ruled for that option when it filed this card, andpendingAgainis one of the card's dedupe words. The answer's shape follows this file's own precedent:notAppliedis also present only on a re-add. It also follows the repo's flag-present-only-when-true shape...(cond ? { key: true } : {}), whichservedOverride: true(packages/metadata-protocol/src/protocol-meta-item-reads.ts) andtruncated: true(packages/mcp/src/mcp-http-tools.ts) use too.Why the dialog skips the field on a fresh add.
ui/packages/app-shell/src/views/ActionResultDialog.tsxmaps each declared field toreadPath(data, field.path), then runs.filter(({ field, value }) => field.path === '' || value !== undefined). A path missing from the answer resolves toundefinedand is dropped (the header contract says the same).format: 'json'is used because the value is a boolean:valueFitsFormatgivestexta string only, and anything else falls back tojsonanyway.The released sentence. In
packages/platform-objects/CHANGELOG.md, 18.5.0, entry 2e1e3b9, the sentence "The Add User result names an address that was already pending" was untrue for an email-only re-add. Once this lands it is true: the result shows "Already pending" on every re-add, including one that sends only an email.Tests
On head 0ad415b:
pending-sso-users.test.ts, describe[#34651] add-sso-user says a re-added address was already pending, and only then): an email-only re-add answers 200 withpendingAgaintrue(andalreadyPendingtrue). CONTROL: a fresh add answers 201 with nopendingAgainproperty.[#34651] the import result table reads members of a real row answer): the test stages the import door with a fresh add whose manager is unknown, a malformed address and a re-add that sends a column. It asserts that the first segment of every column path ofsys_user.import_sso_users'stablefield is a member of a real row answer.cloud-managed-visibility.test.ts, describeadd_sso_user names an address that was already pending):add_sso_userdeclares exactly one field readingpendingAgain(label and format pinned). CONTROL: no field readsalreadyPending.vitest run285 files, 5997 passed, 10 skipped; platform-objectsvitest run123 files, 2047 passed;typecheckfor both packages exit 0 (test layers included throughcheck:test-typecheck).Ablations (scripts/ablation-replace.mjs; each leg restored, blob == HEAD and git diff HEAD empty)
The tests import
pending-sso-users.tsandsys-user.object.tsby relative path, so the source is what runs and nodist/step applies....(outcome.alreadyPending ? { pendingAgain: true } : {}),, anchor 1 to 0):-t 34651gave 1 failed and 2 passed. The re-add pin was red, and the two controls (fresh add, alignment) stayed green.pendingAgainfield pin was red and the control stayed green.notApplieddeleted from the door's row answer (anchor 1 to 0): the alignment pin failed withexpected [ 'notApplied' ] to deeply equal [].Acceptance notes
content/docs/permissions/authentication.mdxline 1340 says the add door "answers201, or200withalreadyPending". It does not mentionpendingAgain. That is outside this card's file surface, and the sentence is still true.pendingAgain, but no invitation is sent then (host.reasonreadsdeactivated), so "told again" would be wrong there. The import table'salreadyPendingcolumn andsummary.alreadyPendingalready use "told again" for that same deactivated row. This PR leaves them as they are.SysUserthrough@objectstack/platform-objects/identity, which resolves to that package'sdist/(a listed unaliased pair incheck-test-source-alias). CI builds it first.Verification
Local gates on 0ad415b
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 73 commands against merge base 3446f23. Each was run with stdin closed, and its exit code was captured before any pipe.node scripts/check-plugin-teardown-shape.mjs --self-testfirst exited 3 because its fixture commit 621a487 was missing from the shallow clone. After a depth-1 fetch of that commit it exited 0 ("48 cases pass").pnpm check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET: it needs a whole-workspace build). This narrowing is declared; Lint & Repo Gates runs it in CI.--ranreconciliation: "73 derived famil(ies) accounted for — 72 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)".node scripts/check-i18n-bundles.mjs --filter=platform-objects: exit 0, "all bundles in sync".node scripts/pm/overlap-check.mjs --repo=objectstack-ai/objectstack: exit 0, "VERDICT clean". It merges cleanly with origin/main 3483407 and with fix(auth)!: a server outside development mode refuses a development seed credential #34717, which shares the translation bundles andsys-user.object.ts.pnpm --filter '@objectstack/plugin-auth^...' buildVERDICT command-exit 0, thenturbo run build --filter=@objectstack/cli --filter=@objectstack/platform-objectsVERDICT command-exit 0.Generated by Claude Code